import {RESCUE_FLOW, RESCUE_NOTICE, RESCUE_STUDY, COUNT_TIME, COURSE_LIST} from "./requestUrl.js"
import {request} from './requst.js'
import store from '../store/index.js'

export function getRescueFlow() {
	return request({
		url: RESCUE_FLOW,
		method: 'post'
	})
}

export function getRescueStudy() {
	return request({
		url: RESCUE_STUDY,
		method: 'post'
	})
}

export function getRescueNotice() {
	return request({
		url: RESCUE_NOTICE,
		method: 'post'
	})
}

export function appendStudyTime(study_time) {
	return request({
		url: COUNT_TIME,
		method: 'post',
		data: {
			study_time,
			user_id: store.state.userInfo.user_id
		}
	})
}

// 获取课程列表
export function getStudyList() {
	return request({
		url: COURSE_LIST,
		method: 'post',
	})
}